package com.hqj.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.refresh.ContextRefresher;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
public class AutoRefreshConfig {

    @Autowired
    private ContextRefresher contextRefresher;

    @Scheduled(fixedRate = 2000L)
    //@Scheduled(cron = "*/5 * * * * ?")
    public void autoRefresh(){
        System.out.println("test");
        contextRefresher.refresh();
    }
}
